package com.qzsoft.zhjd.cement.modules.cementmatch.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName CementMatchEntity
 * @Description 水稳生产配比
 * @author linhuawei
 * @since 2022-04-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_cement_match")
public class CementMatchEntity {

    @NotBlank(groups = UpdateGroup.class, message = "配方标识不可为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地编号
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String baseCode;

    /**
     * 项目主键
     */
    @NotBlank(groups = AddGroup.class, message = "所属项目不能为空！")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String projectId;

    /**
     * 拌和楼编号
     */
    @NotBlank(groups = AddGroup.class, message = "拌和站不能为空！")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String stationCode;

    /**
     * 配方编号
     */
    @NotBlank(groups = AddGroup.class, message = "配方编号不能为空！")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String matchCode;

    /**
     * 摊铺层级
     */
    @Length(max = 20, message = "摊铺层级长度不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String pavingLevel;

    /**
     * 集料1占比
     */
    @DecimalMax(value = "100", message = "集料1占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel1;

    /**
     * 集料2占比
     */
    @DecimalMax(value = "100", message = "集料2占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel2;

    /**
     * 集料3占比
     */
    @DecimalMax(value = "100", message = "集料3占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel3;

    /**
     * 集料4占比
     */
    @DecimalMax(value = "100", message = "集料4占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel4;

    /**
     * 集料5占比
     */
    @DecimalMax(value = "100", message = "集料5占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel5;

    /**
     * 集料6占比
     */
    @DecimalMax(value = "100", message = "集料6占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal gravel6;

    /**
     * 水泥1占比
     */
    @DecimalMax(value = "100", message = "水泥1占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal powder1;

    /**
     * 水泥2占比
     */
    @DecimalMax(value = "100", message = "水泥2占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal powder2;

    /**
     * 水占比
     */
    @DecimalMax(value = "100", message = "水占比不能超过{value}")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal water;

    /**
     * 集料1占比
     */
    @Length(max = 20, message = "集料1名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel1Name;

    /**
     * 集料2占比
     */
    @Length(max = 20, message = "集料2名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel2Name;

    /**
     * 集料3占比
     */
    @Length(max = 20, message = "集料3名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel3Name;

    /**
     * 集料4占比
     */
    @Length(max = 20, message = "集料4名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel4Name;

    /**
     * 集料5占比
     */
    @Length(max = 20, message = "集料5名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel5Name;

    /**
     * 集料6占比
     */
    @Length(max = 20, message = "集料6名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String gravel6Name;

    /**
     * 水泥1名称
     */
    @Length(max = 20, message = "水泥1名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String powder1Name;

    /**
     * 水泥2名称
     */
    @Length(max = 20, message = "水泥2名称不能超过{max}个字")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String powder2Name;

    /**
     * 添加人
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private String creator;

    /**
     * 添加时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updater;

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

}
